package com.hunt.app.controller;

import com.hunt.model.app.ApkUpload;
import com.hunt.service.app.ApkService;
import com.hunt.util.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Author: ww
 * @Date : 2020/10/19
 */

@Api(value = "app版本号查询")
@Controller
@RequestMapping(path = "/app/apkVersion")
public class ApkController {

    @Autowired
    private ApkService apkService;

    @ApiOperation(value = "传入apk版本,检验是否需要更新", httpMethod = "POST", produces = "application/json", response = Result.class)
    @ResponseBody
    @RequestMapping(value = "checkApkVersion", method = RequestMethod.POST)
    public Result checkApkVersion() {
        ApkUpload newApp = apkService.findNewApp();
        return Result.success(newApp);
    }
}
